package cn.com.wantools.web.api.wantools;

import cn.com.wantools.commons.Rets;
import cn.com.wantools.model.loanrate.LoanRateInfo;
import cn.com.wantools.model.unitconvert.UcGroupDto;
import cn.com.wantools.service.LoanRateService;
import cn.com.wantools.service.UcIndexService;
import cn.com.wantools.web.base.ApiControllerBase;
import com.jfinal.aop.Inject;
import com.jfinal.kit.Ret;
import io.jboot.apidoc.ContentType;
import io.jboot.apidoc.annotation.Api;
import io.jboot.apidoc.annotation.ApiOper;
import io.jboot.web.controller.annotation.RequestMapping;

import java.util.List;

@RequestMapping("/api/loanRateApi")
@Api("利率API ")
public class LoanRateApiController extends ApiControllerBase {
    @Inject
    private LoanRateService loanRateService;

    @ApiOper(value = "首页布局", contentType = ContentType.JSON)
    public Ret loadLoanRate() {
        try {
            List<LoanRateInfo> loanRateInfoList = loanRateService.getLoanRate();
            return Ret.create("loanRateInfoList", loanRateInfoList);
        } catch (Exception e) {
            return Rets.FAIL;
        }
    }


}
